<template>
	<div class="page" data-page="unitVRview" style="z-index: 2;">
		<div class="navbar vr-head">
			<div class="navbar-inner sliding">
                <div class="left">
                  <a href="#" class="link back" @click="$root.backToTab()">
                    <i class="icon icon-back"></i>
                    <span class="ios-only">Back</span>
                  </a>
                </div>
            <div class="title sliding" style="left: -25px;">VR全景</div>
        </div>
    </div>
    <div id="vr-content" class="page-content"> 
    </div>
  </div>
</template>
<script>
  return{
      on: {
          pageInit: function (e, page){
              common.loading(1);
              var src  = decodeURIComponent(this.$route.params.id);
              var size = screen.height - $(".vr-head").height();
              setTimeout(function(){
                  jQuery("#vr-content").append(`<iframe id="vrIframe" style="width: `+screen.width+`px;height:`+size+`px;" class="unitVRview-content"  src="`+src+`" frameborder="0" scrolling="no"></iframe>`);
                  common.loading(0);
              },1000);
          },
          pageBeforeOut: function(e, page) {
              //Do：方法销毁、内存释放
              jQuery("#vrIframe").attr('src','about:blank');
              try {
                 jQuery("#vrIframe").contentWindow.document.write('');
                 jQuery("#vrIframe").contentWindow.document.clear();
              } catch (e) {
                
              }
              jQuery("#vr-content")[0].removeChild($("#vr-content")[0].childNodes[1]);
            }
      },
  }
</script>